/*
 * Selling Partner API for Replenishment
 *
 * The Selling Partner API for Replenishment (Replenishment API) provides programmatic access to replenishment program metrics and offers. These programs provide recurring delivery of any replenishable item at a frequency chosen by the customer.  The Replenishment API is available worldwide wherever Amazon Subscribe & Save is available or is supported. The API is available to vendors and FBA selling partners.
 *
 * The version of the OpenAPI document: 2022-11-07
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.replenishment.v2022_11_07
{
    /// <summary>
    /// The request body for the &#x60;getSellingPartnerMetrics&#x60; operation.
    /// </summary>
    [DataContract(Name = "GetSellingPartnerMetricsRequest")]
    public partial class GetSellingPartnerMetricsRequest : IValidatableObject
    {

        /// <summary>
        /// Gets or Sets AggregationFrequency
        /// </summary>
        [DataMember(Name = "aggregationFrequency", EmitDefaultValue = false)]
        public AggregationFrequency? AggregationFrequency { get; set; }

        /// <summary>
        /// Gets or Sets TimePeriodType
        /// </summary>
        [DataMember(Name = "timePeriodType", IsRequired = true, EmitDefaultValue = true)]
        public TimePeriodType TimePeriodType { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetSellingPartnerMetricsRequest" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected GetSellingPartnerMetricsRequest() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetSellingPartnerMetricsRequest" /> class.
        /// </summary>
        /// <param name="aggregationFrequency">aggregationFrequency.</param>
        /// <param name="timeInterval">timeInterval (required).</param>
        /// <param name="metrics">The list of metrics requested. If no metric value is provided, data for all of the metrics will be returned..</param>
        /// <param name="timePeriodType">timePeriodType (required).</param>
        /// <param name="marketplaceId">The marketplace identifier. The supported marketplaces for both sellers and vendors are US, CA, ES, UK, FR, IT, IN, DE and JP. The supported marketplaces for vendors only are BR, AU, MX, AE and NL. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) to find the identifier for the marketplace. (required).</param>
        /// <param name="programTypes">A list of replenishment program types. (required).</param>
        public GetSellingPartnerMetricsRequest(AggregationFrequency? aggregationFrequency = default(AggregationFrequency?), TimeInterval timeInterval = default(TimeInterval), List<Metric> metrics = default(List<Metric>), TimePeriodType timePeriodType = default(TimePeriodType), string marketplaceId = default(string), List<ProgramType> programTypes = default(List<ProgramType>))
        {
            // to ensure "timeInterval" is required (not null)
            if (timeInterval == null)
            {
                throw new ArgumentNullException("timeInterval is a required property for GetSellingPartnerMetricsRequest and cannot be null");
            }
            this.TimeInterval = timeInterval;
            this.TimePeriodType = timePeriodType;
            // to ensure "marketplaceId" is required (not null)
            if (marketplaceId == null)
            {
                throw new ArgumentNullException("marketplaceId is a required property for GetSellingPartnerMetricsRequest and cannot be null");
            }
            this.MarketplaceId = marketplaceId;
            // to ensure "programTypes" is required (not null)
            if (programTypes == null)
            {
                throw new ArgumentNullException("programTypes is a required property for GetSellingPartnerMetricsRequest and cannot be null");
            }
            this.ProgramTypes = programTypes;
            this.AggregationFrequency = aggregationFrequency;
            this.Metrics = metrics;
        }

        /// <summary>
        /// Gets or Sets TimeInterval
        /// </summary>
        [DataMember(Name = "timeInterval", IsRequired = true, EmitDefaultValue = true)]
        public TimeInterval TimeInterval { get; set; }

        /// <summary>
        /// The list of metrics requested. If no metric value is provided, data for all of the metrics will be returned.
        /// </summary>
        /// <value>The list of metrics requested. If no metric value is provided, data for all of the metrics will be returned.</value>
        [DataMember(Name = "metrics", EmitDefaultValue = false)]
        public List<Metric> Metrics { get; set; }

        /// <summary>
        /// The marketplace identifier. The supported marketplaces for both sellers and vendors are US, CA, ES, UK, FR, IT, IN, DE and JP. The supported marketplaces for vendors only are BR, AU, MX, AE and NL. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) to find the identifier for the marketplace.
        /// </summary>
        /// <value>The marketplace identifier. The supported marketplaces for both sellers and vendors are US, CA, ES, UK, FR, IT, IN, DE and JP. The supported marketplaces for vendors only are BR, AU, MX, AE and NL. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) to find the identifier for the marketplace.</value>
        [DataMember(Name = "marketplaceId", IsRequired = true, EmitDefaultValue = true)]
        public string MarketplaceId { get; set; }

        /// <summary>
        /// A list of replenishment program types.
        /// </summary>
        /// <value>A list of replenishment program types.</value>
        [DataMember(Name = "programTypes", IsRequired = true, EmitDefaultValue = true)]
        public List<ProgramType> ProgramTypes { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class GetSellingPartnerMetricsRequest {\n");
            sb.Append("  AggregationFrequency: ").Append(AggregationFrequency).Append("\n");
            sb.Append("  TimeInterval: ").Append(TimeInterval).Append("\n");
            sb.Append("  Metrics: ").Append(Metrics).Append("\n");
            sb.Append("  TimePeriodType: ").Append(TimePeriodType).Append("\n");
            sb.Append("  MarketplaceId: ").Append(MarketplaceId).Append("\n");
            sb.Append("  ProgramTypes: ").Append(ProgramTypes).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
